package com.guguskins.back.common.security.utils;

import com.guguskins.back.utils.MessageMD5;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Component;

@Component
public class DefaultPasswordEncoder implements PasswordEncoder {
    @Override

    public String encode(CharSequence charSequence) {
        return MessageMD5.MD5(charSequence.toString());
    }

    @Override
    public boolean matches(CharSequence charSequence, String s) {
        return s.equals(MessageMD5.MD5(charSequence.toString()));
    }
}
